<?php

namespace App\Http\Requests\Api\Admin;

use App\Http\Requests\Api\FormRequest;

class AdminRoleRequest extends FormRequest
{
    public function rules()
    {
        return [
            'role_name' => ['required', 'max:22', 'min:2', 'unique:admin_role,role_name'],
            'role_content' => ['required', 'string'],
        ];
    }

    public function messages()
    {
        return [
            'role_name.unique' => '角色名已经存在',
            'role_name.required' => '角色名必须填写',
            'max' => ':attribute 不能太长或太短',
            'min' => ':attribute 不能太长或太短',
            'role_content.required' => '工作内容必须填写',
        ];
    }

}
